<template>
  <div class="back-to-top" @click="backToTop">
    <uni-icons type="top" size="25" color="#00cc99"></uni-icons>
  </div>
</template>

<script lang="ts" setup>
const emit = defineEmits(["setScrollTop"]);

const backToTop = () => {
  emit("setScrollTop", 0);
};
</script>

<style scoped lang="scss">
.back-to-top {
  position: fixed;
  right: 50rpx;
  bottom: 50rpx;
  width: 80rpx;
  height: 80rpx;
  background-color: #fff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 1px 1px 1px #000;
}
</style>
